using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace TVSGPP.tools
{
	public class frmAppOptionBook : Form
	{
		private IContainer components = null;
		private Button btnSave;
		public GroupBox grB1;
		private Label label1;
		private ComboBox cbbBookTemp;
		private Label label2;
		private ComboBox cbbSlideEffect;
		private Label label3;
		private ComboBox cbbPatients;
		private Label label4;
		private ComboBox cbbBookSaleNotBill;
		public frmAppOptionBook()
		{
			this.InitializeComponent();
		}
		private void btnSave_Click(object sender, EventArgs e)
		{
			try
			{
				RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\TVSGPP", true);
				if (this.grB1.Enabled)
				{
					registryKey.SetValue("BookTempNum", this.cbbBookTemp.SelectedIndex.ToString());
					registryKey.SetValue("BookSlideEffect", this.cbbSlideEffect.SelectedIndex.ToString());
					registryKey.SetValue("BookPatients", this.cbbPatients.SelectedIndex.ToString());
					registryKey.SetValue("SaleNotBill", this.cbbBookSaleNotBill.SelectedIndex.ToString());
				}
				registryKey.Close();
				MessageBox.Show("Dữ liệu đã được cập nhật vào hệ thống!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void frmAppOptionMain_Load(object sender, EventArgs e)
		{
			try
			{
				RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\TVSGPP", true);
				if (this.grB1.Enabled)
				{
					this.cbbBookTemp.SelectedIndex = int.Parse(registryKey.GetValue("BookTempNum").ToString());
					this.cbbSlideEffect.SelectedIndex = int.Parse(registryKey.GetValue("BookSlideEffect").ToString());
					this.cbbPatients.SelectedIndex = int.Parse(registryKey.GetValue("BookPatients").ToString());
					this.cbbBookSaleNotBill.SelectedIndex = int.Parse(registryKey.GetValue("SaleNotBill").ToString());
				}
				registryKey.Close();
			}
			catch
			{
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.grB1 = new GroupBox();
			this.label3 = new Label();
			this.cbbPatients = new ComboBox();
			this.label2 = new Label();
			this.cbbSlideEffect = new ComboBox();
			this.label1 = new Label();
			this.cbbBookTemp = new ComboBox();
			this.btnSave = new Button();
			this.label4 = new Label();
			this.cbbBookSaleNotBill = new ComboBox();
			this.grB1.SuspendLayout();
			base.SuspendLayout();
			this.grB1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.grB1.Controls.Add(this.label4);
			this.grB1.Controls.Add(this.cbbBookSaleNotBill);
			this.grB1.Controls.Add(this.label3);
			this.grB1.Controls.Add(this.cbbPatients);
			this.grB1.Controls.Add(this.label2);
			this.grB1.Controls.Add(this.cbbSlideEffect);
			this.grB1.Controls.Add(this.label1);
			this.grB1.Controls.Add(this.cbbBookTemp);
			this.grB1.Enabled = false;
			this.grB1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.grB1.Location = new Point(12, 7);
			this.grB1.Name = "grB1";
			this.grB1.Size = new Size(375, 374);
			this.grB1.TabIndex = 0;
			this.grB1.TabStop = false;
			this.grB1.Text = "Mẫu sổ theo dõi";
			this.label3.AutoSize = true;
			this.label3.Font = new Font("Arial", 9f);
			this.label3.Location = new Point(83, 92);
			this.label3.Name = "label3";
			this.label3.Size = new Size(73, 15);
			this.label3.TabIndex = 5;
			this.label3.Text = "Bệnh nhân :";
			this.cbbPatients.Cursor = Cursors.Hand;
			this.cbbPatients.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbPatients.Font = new Font("Arial", 9f);
			this.cbbPatients.FormattingEnabled = true;
			this.cbbPatients.Items.AddRange(new object[]
			{
				"Mẫu thứ 1",
				"Mẫu thứ 2"
			});
			this.cbbPatients.Location = new Point(159, 88);
			this.cbbPatients.Name = "cbbPatients";
			this.cbbPatients.Size = new Size(187, 23);
			this.cbbPatients.TabIndex = 4;
			this.label2.AutoSize = true;
			this.label2.Font = new Font("Arial", 9f);
			this.label2.Location = new Point(68, 63);
			this.label2.Name = "label2";
			this.label2.Size = new Size(88, 15);
			this.label2.TabIndex = 3;
			this.label2.Text = "Tác dụng phụ :";
			this.cbbSlideEffect.Cursor = Cursors.Hand;
			this.cbbSlideEffect.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbSlideEffect.Font = new Font("Arial", 9f);
			this.cbbSlideEffect.FormattingEnabled = true;
			this.cbbSlideEffect.Items.AddRange(new object[]
			{
				"Mẫu thứ 1",
				"Mẫu thứ 2"
			});
			this.cbbSlideEffect.Location = new Point(159, 59);
			this.cbbSlideEffect.Name = "cbbSlideEffect";
			this.cbbSlideEffect.Size = new Size(187, 23);
			this.cbbSlideEffect.TabIndex = 2;
			this.label1.AutoSize = true;
			this.label1.Font = new Font("Arial", 9f);
			this.label1.Location = new Point(52, 34);
			this.label1.Name = "label1";
			this.label1.Size = new Size(104, 15);
			this.label1.TabIndex = 1;
			this.label1.Text = "Nhiệt độ - độ ẩm :";
			this.cbbBookTemp.Cursor = Cursors.Hand;
			this.cbbBookTemp.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbBookTemp.Font = new Font("Arial", 9f);
			this.cbbBookTemp.FormattingEnabled = true;
			this.cbbBookTemp.Items.AddRange(new object[]
			{
				"Mẫu thứ 1 [ 4 cột ]",
				"Mẫu thứ 2 [ 2 Cột ]"
			});
			this.cbbBookTemp.Location = new Point(159, 30);
			this.cbbBookTemp.Name = "cbbBookTemp";
			this.cbbBookTemp.Size = new Size(187, 23);
			this.cbbBookTemp.TabIndex = 0;
			this.btnSave.Cursor = Cursors.Hand;
			this.btnSave.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnSave.Location = new Point(12, 387);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new Size(90, 30);
			this.btnSave.TabIndex = 11;
			this.btnSave.Text = "Ghi nhận";
			this.btnSave.UseVisualStyleBackColor = true;
			this.btnSave.Click += new EventHandler(this.btnSave_Click);
			this.label4.AutoSize = true;
			this.label4.Font = new Font("Arial", 9f);
			this.label4.Location = new Point(10, 121);
			this.label4.Name = "label4";
			this.label4.Size = new Size(147, 15);
			this.label4.TabIndex = 7;
			this.label4.Text = "Sổ bán thuốc không đơn :";
			this.cbbBookSaleNotBill.Cursor = Cursors.Hand;
			this.cbbBookSaleNotBill.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbBookSaleNotBill.Font = new Font("Arial", 9f);
			this.cbbBookSaleNotBill.FormattingEnabled = true;
			this.cbbBookSaleNotBill.Items.AddRange(new object[]
			{
				"Mẫu thứ 1",
				"Mẫu thứ 2"
			});
			this.cbbBookSaleNotBill.Location = new Point(159, 117);
			this.cbbBookSaleNotBill.Name = "cbbBookSaleNotBill";
			this.cbbBookSaleNotBill.Size = new Size(187, 23);
			this.cbbBookSaleNotBill.TabIndex = 6;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			this.BackColor = Color.White;
			base.ClientSize = new Size(399, 427);
			base.Controls.Add(this.btnSave);
			base.Controls.Add(this.grB1);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			base.Name = "frmAppOptionBook";
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "Tuỳ biến giao diện";
			base.Load += new EventHandler(this.frmAppOptionMain_Load);
			this.grB1.ResumeLayout(false);
			this.grB1.PerformLayout();
			base.ResumeLayout(false);
		}
	}
}
